from selenium import webdriver
from time import sleep
import unittest
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys

class do_jenkins(unittest.TestCase):
    # -*- coding: utf-8 -*-
    driver=webdriver.Chrome()
    driver.get("http://10.59.9.12:7001/")
    driver.maximize_window()
    sleep(2)
    def test_A3mall_01(self):
        self.driver.find_element(By.XPATH,'//*[@id="searchForm"]/div[1]/input').send_keys("非洲之心",Keys.ENTER)
        sleep(2)
        spname=self.driver.find_element(By.XPATH,'/html/body/div[5]/div[2]/div[2]/div[1]/ul/li/div[1]/em/a').text
        print("商品名称："+spname)
        self.driver.find_element(By.XPATH,'/html/body/div[5]/div[2]/div[2]/div[1]/ul/li/div[1]/span/a/img').click()
        sleep(3)



if __name__ == '__main__':
    unittest.main()